import time
import datetime
a=input('请输入日期，格式为YYYY-MM-DD')
t=time.strptime(a,"%Y-%m-%d")
y,m,d=t[0:3]
def IsRUN(y):
    if y%400==0 or ( y%4==0 and y%100!=0 ):
        return 1
    else:
        return 0

month=[
    [31,28,31,30,31,30,31,31,30,31,30,31],
    [31,29,31,30,31,30,31,31,30,31,30,31],
]

if d<month[IsRUN(y)][m-1]:
    print(y,m,d+1)
elif m!=12:
    print(y,m+1,1)
else:
    print(y+1,1,1)
